<template>
  <tr>
    <td>合计:</td>
    <td colspan="5">{{ sum }}</td>
  </tr>
</template>

<script>
export default {
  props: ['arr'],
  computed: {
    sum() {
      return this.arr.reduce((prev, item) => {
        if (item.checked) {
          prev += item.price * item.num;
        }
        return prev;
      }, 0);
    },
  },

}
</script>

<style>
</style>